var util=require('util');
var event=require('events');

var Ticker= function () {
    var self=this;
    setInterval(function () {
        self.emit('tick',Date.now());
    },1000);
};
//util.inherits(Ticker,event);

//ES6
Ticker.prototype=Object.create(event.prototype);

var t1=new Ticker();
t1.on('tick', function (time) {
    console.log('tick time:',time);
});

